home *** CD-ROM | disk | FTP | other *** search
/ Game.EXE 2001 January / Game.EXE_01_2001.iso / demos / Blade of Darkness / data1.cab / Program_Executable_Files / Lib / PhantonFX.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2000-11-16  |  2.6 KB  |  86 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 1.5)
  3.  
  4. import Bladex
  5. Bladex.CreateTimer('AlphaTimer', 0.05)
  6. Delta = 0.025
  7. SecAgo = 0.0
  8. OnAppears = { }
  9. OnDisappears = { }
  10.  
  11. def Appears(e_name, time):
  12.     esq = Bladex.GetEntity(e_name)
  13.     if esq.Person and esq.InvRight:
  14.         Der = Bladex.GetEntity(esq.InvRight)
  15.     else:
  16.         Der = None
  17.     if esq.Person and esq.InvLeft:
  18.         Izq = Bladex.GetEntity(esq.InvLeft)
  19.     else:
  20.         Izq = None
  21.     val = esq.Alpha + OnAppears[e_name][1]
  22.     if val >= 1.0:
  23.         esq.TimerFunc = ''
  24.         esq.RemoveFromList('AlphaTimer')
  25.         val = 1.0
  26.         if OnAppears[e_name][0] != '':
  27.             OnAppears[e_name][0](e_name)
  28.             del OnAppears[e_name]
  29.         
  30.     
  31.     esq.Alpha = val
  32.     if Der:
  33.         Der.Alpha = val
  34.     
  35.     if Izq:
  36.         Izq.Alpha = val
  37.     
  38.  
  39.  
  40. def Disappears(e_name, time):
  41.     esq = Bladex.GetEntity(e_name)
  42.     if esq.Person and esq.InvRight:
  43.         Der = Bladex.GetEntity(esq.InvRight)
  44.     else:
  45.         Der = None
  46.     if esq.Person and esq.InvLeft:
  47.         Izq = Bladex.GetEntity(esq.InvLeft)
  48.     else:
  49.         Izq = None
  50.     val = esq.Alpha - OnDisappears[e_name][1]
  51.     if val <= 0.0:
  52.         esq.TimerFunc = ''
  53.         esq.RemoveFromList('AlphaTimer')
  54.         if esq.Person:
  55.             esq.Life = 0
  56.         
  57.         Bladex.AddScheduledFunc(Bladex.GetTime() + OnDisappears[e_name][2], esq.SubscribeToList, ('Pin',))
  58.         val = 0.0
  59.         if OnDisappears[e_name][0] != '':
  60.             OnDisappears[e_name][0](e_name)
  61.             del OnDisappears[e_name]
  62.         
  63.     
  64.     esq.Alpha = val
  65.     if Der:
  66.         Der.Alpha = val
  67.     
  68.     if Izq:
  69.         Izq.Alpha = val
  70.     
  71.  
  72.  
  73. def AppearsChar(charnam, func = ''):
  74.     esq = Bladex.GetEntity(charnam)
  75.     esq.TimerFunc = Appears
  76.     esq.SubscribeToList('AlphaTimer')
  77.     OnAppears[charnam] = (func, Delta, SecAgo)
  78.  
  79.  
  80. def DisappearsChar(charnam, func = ''):
  81.     esq = Bladex.GetEntity(charnam)
  82.     esq.TimerFunc = Disappears
  83.     esq.SubscribeToList('AlphaTimer')
  84.     OnDisappears[charnam] = (func, Delta, SecAgo)
  85.  
  86.